package pack;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 *
 * @author Jadalbert
 */
public class Hello{
    static List<Gasket> lt = new ArrayList<Gasket>();
    static int con ;
    
 public static void main(String[] args){
     
    System.out.println("Tworzenie obiektów.");

    lt.add(new Gasket(0));
        
    System.out.println("Ile dodać stanów pracy?");
    Scanner sc = new Scanner(System.in);
        
    con = sc.nextInt();
    for (int i = 1; i <= con; i++) {
        lt.add(new Gasket(i));
        lt.get(i).setOd(100 + 2 * i); lt.get(i).setId(80 + 3 * i);
    }
    
    
    
    System.out.println("Który stan skasować?");
    int i = sc.nextInt();
    if (i != 0) {
        lt.remove(i);
        con = con - 1;
    }
    print();
 }
    
    private static void print() {
        System.out.println("Gasket " + 0);
        System.out.println("od = " + lt.get(0).getOd() + "; " + "id = " + lt.get(0).getId());        
        System.out.println("u = " + lt.get(0).getU());
        for (int i = 1; i <= con; i++) {
            System.out.println("Gasket " + i);
            System.out.println("od = " + lt.get(i).getOd() + "; " + "id = " + lt.get(i).getId());
            System.out.println("u = " + lt.get(i).getU());
    }
        System.out.println("Liczba obiektów " + lt.size());    
    }
    
}
